package com.university.evaluation.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.university.evaluation.common.ResponseResult;
import com.university.evaluation.entity.StudentTotalScore;
import java.util.List;
import java.util.Map;
/**
 学生总分服务接口
 所有方法都返回 ResponseResult，以实现统一的响应处理和错误管理
 */
public interface StudentTotalScoreService extends IService<StudentTotalScore> {
    // --- 查询操作 ---
    ResponseResult<StudentTotalScore> findByStudentIdAndSystemId(String studentId, Long systemId);
    ResponseResult<List<StudentTotalScore>> findBySystemId(Long systemId);
    ResponseResult<List<StudentTotalScore>> findByClassIdAndSystemId(Long classId, Long systemId);
    ResponseResult<List<StudentTotalScore>> findByMajorIdAndSystemId(Long majorId, Long systemId);
    ResponseResult<List<StudentTotalScore>> findByDepartmentIdAndSystemId(Long departmentId, Long systemId);

    // 新增缺失的方法
    ResponseResult<List<StudentTotalScore>> findByStudentId(String studentId);
    ResponseResult<List<StudentTotalScore>> findByScoreRange(Long systemId, Double minScore, Double maxScore);
// --- 计算与操作 ---
    /**
     计算指定测评体系下，所有学生的总分
     @param systemId 测评体系ID
     @return 操作结果
     */
    ResponseResult<?> calculateAllScoresBySystemId(Long systemId);
    /**
     重新计算单个学生的总分
     @param studentId 学号
     @param systemId 测评体系ID
     @return 操作结果
     */
    ResponseResult<?> recalculateStudentScore(String studentId, Long systemId);
    /**
     为指定测评体系下的所有成绩进行排名
     @param systemId 测评体系ID
     @return 操作结果
     */
    ResponseResult<?> updateRankingBySystemId(Long systemId);
    // --- 发布与状态变更 ---
    ResponseResult<?> publishScores(Long systemId);
    ResponseResult<?> withdrawScores(Long systemId);
    // --- 统计分析 ---
    ResponseResult<Map<String, Object>> getScoreStatistics(Long systemId);
}